package com.aaa.behind.service.impl;

import com.aaa.behind.dao.BBusinessInfoMapper;
import com.aaa.behind.service.IBBusinessInfoService;
import com.aaa.entity.BBusinessInfo;
import com.aaa.entity.BusinessSort;
import com.aaa.util.PageInfo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 商家信息表 服务实现类
 * </p>
 *
 * @author whj
 * @since 2023-01-05
 */
@Service
public class BBusinessInfoServiceImpl extends ServiceImpl<BBusinessInfoMapper, BBusinessInfo> implements IBBusinessInfoService {

    @Resource
    private  BBusinessInfoMapper bBusinessInfoMapper;
    @Override
    public Page<BBusinessInfo> getPageData(PageInfo page, BBusinessInfo businessInfo) {
        QueryWrapper queryWrapper = new QueryWrapper();
        if (businessInfo.getStatus() != null){
            queryWrapper.eq("status",businessInfo.getStatus());
        }
        return this.page(page,queryWrapper);
    }

    @Override
    public List<BusinessSort> findSortid() {
        return bBusinessInfoMapper.findSortid();
    }

    @Override
    public String selectId(String sname) {
        return bBusinessInfoMapper.selectId(sname);
    }

    @Override
    public IPage selectAll(PageInfo page, BBusinessInfo businessInfo) {
        return bBusinessInfoMapper.selectAll(page,businessInfo);
    }

    @Override
    public String selectSortId(String sortid) {
        return bBusinessInfoMapper.selectSortId(sortid);
    }
}
